//
// Created by win10 on 2024/12/30.
//
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAXSIZE 50

// 顺序表的结构体定义
typedef int ElemType;
typedef struct {
    ElemType *R;
    int length;
} SSTable;

// 初始化顺序表
void InitList(SSTable *L) {
    L->R = (ElemType *)malloc(MAXSIZE * sizeof(ElemType));
    if (!L->R) {
        printf("内存分配失败\n");
        exit(1);
    }
    L->length = 0;
}

// 构建顺序表，输入元素
void CreateList(SSTable *L, int n) {
    L->length = n;
    for (int i = 0; i < n; i++) {
        scanf("%d", &L->R[i]);
    }
}

// 折半查找函数
int BinarySearch(SSTable L, ElemType key) {
    int low = 0;
    int high = L.length - 1;
    int count = 0;
    while (low <= high) {
        count++;
        int mid = (low + high) / 2;
        if (L.R[mid] == key) {
            return mid + 1;
        } else if (L.R[mid] < key) {
            low = mid + 1;
        } else {
            high = mid - 1;
        }
    }
    return -1;
}

int main() {
    SSTable L;
    InitList(&L);

    int n;
    scanf("%d", &n);
    CreateList(&L, n);

    ElemType target;
    scanf("%d", &target);

    int result = BinarySearch(L, target);
    if (result!= -1) {
        printf("%d\n", result);
    } else {
        printf("NOT FOUND\n");
    }

    free(L.R);
    return 0;
}